import React, { Component } from 'react';
import '../styles/MyEntry.scss'
import * as service from '../api/index'

import pic11 from '../assets/11.gif'


class MyEntry extends Component {
    constructor(props) {
        super(props)
        this.state = {
            list: []
        }
    }
    async componentDidMount(){
        let res=await service.index_nav()
        // console.log(res.data.list);
        this.setState({list:res.data.list})
    }
    render() {
        return (
            <div className='entry'>
                <div className="message">
                    1分抵1元。请您点击此处查看《购物须知》
                </div>
                <div className="list">
                    {
                        this.state.list.map((item, index) => {
                            return (
                                <div className="entry_item" key={index}>
                                    <img src={item.pic} alt="" />
                                    <div className="text">
                                        {item.name}
                                    </div>
                                </div>
                            )
                        })
                    }
                </div>
                <div className="night">
                    <img src={pic11} alt="" />
                </div>
            </div>
        );
    }
}

export default MyEntry;